Developer --> Technical Publications
PATHMac OS 8 Developer Documentation > Human Interface Toolbox > Window Manager >

Mac OS 8 Window Manager Reference


Retrieving Window Information

The following Window Manager functions for retrieving window information are new or changed with Appearance Manager 1.0:


FindWindow

Maps the location of the cursor to a part of the screen or a region of a window when your application receives a mouse-down event.

pascal short FindWindow (
                     Point thePoint,
                     WindowPtr *theWindow);
thePoint
The point, in global coordinates, where the mouse-down event occurred. Your application retrieves this information from the where field of the event structure.
theWindow
A pointer to the window in which the mouse-down event occurred. FindWindow produces nil if the mouse-down event occurred outside a window.
function result
A short integer that specifies the location of the cursor when the user pressed the mouse button; see FindWindow Result Code Constants.

DISCUSSION

You typically call the function FindWindow whenever you receive a mouse-down event. The FindWindow function helps you dispatch the event by reporting whether the cursor was in the menu bar or in a window when the mouse button was pressed. If the cursor was in a window, the function will produce both a pointer to the window and a constant that identifies the region of the window in which the event occurred. If Appearance is available, FindWindow may return the inCollapseBox constant as one of the possible window regions.


VERSION NOTES

Changed with Appearance Manager 1.0 to support finding events in the collapse box.


GetWindowFeatures

Obtains the features that a window supports.

pascal OSStatus GetWindowFeatures (
                     WindowPtr inWindow,
                     UInt32* outFeatures);
inWindow
A pointer to the window to be examined.
outFeatures
A pointer to an unsigned 32-bit value. On return, the bits of the value specify the features the window supports; see Reporting Window Features.
function result
A result code; see Result Codes.

DISCUSSION

The GetWindowFeatures function produces a window definition function's features in response to a kWindowMsgGetFeatures message. For a list of the features a window might support, see Reporting Window Features.


VERSION NOTES

Available with Appearance Manager 1.0 and later.


GetWindowRegion

Obtains a handle to a specific window region.

pascal OSStatus GetWindowRegion (
                     WindowPtr inWindow,
                     WindowRegionCode inRegionCode,
                     RgnHandle ioWinRgn);
inWindow
A pointer to the window to be examined.
inRegionCode
A constant representing the window region whose handle you wish to obtain; see Window Region Constants.
ioWinRgn
A handle to a region created by your application. On return, the handle is set to the specified window region.
function result
A result code; see Result Codes.

DISCUSSION

The GetWindowRegion function produces a handle to a window definition function's window region in response to a kWindowMsgGetRegion message. The visibility of the window is unimportant for GetWindowRegion to work correctly.


VERSION NOTES

Available with Appearance Manager 1.0 and later.


© 1998 Apple Computer, Inc. - (Last Updated 19 Nov 98)

Previous | Back Up One Level | Next |